package file;

import java.io.File;
import java.io.FileFilter;

public class Test2 {
    public static void main(String[] args) {
        File dir = new File(".");
        if(dir.isDirectory()){
            FileFilter filter = f-> f.getName().contains("s");;
            File[] subs = dir.listFiles(filter);
            for (File sub: subs) {
                System.out.println(sub.getName());
            }
        }








        /*File dir = new File(".");
        if(dir.isDirectory()){
            File[] suns = dir.listFiles(new FileFilter() {
                public boolean accept(File file) {
                    return file.getName().contains("s");
                }
            });
            for (int i = 0; i < suns.length; i++) {
                System.out.println(suns[i].getName());
            }
        }*/
    }
}
